﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="User_Manage.aspx.cs" Inherits="SYS_POPEDOM_User_Manage" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
        .no-icon
        {
            display: none;
        }
    </style>

    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        function nodeLoad(node) {
            Ext.net.DirectMethods.NodeLoad(node.id, {
                success: function(result) {
                    var data = eval("(" + result + ")");
                    node.loadNodes(data);
                },

                failure: function(errorMsg) {
                    Ext.Msg.alert('Failure', errorMsg);
                }
            });
        }

        function nodeClick(node) {
            Ext.net.DirectMethods.NodeClick(node.id);
        }

        function clickNode(node) {
            TreePanel1.fireEvent("click", node);
        }

        function refreshTree() {
            TreePanel1.getSelectionModel().getSelectedNode().reload();

        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="Store1" runat="server" AutoLoad="false" OnRefreshData="OnStoreRefreshData">
        <Reader>
            <ext:JsonReader IDProperty="USER_ID">
                <Fields>
                    <ext:RecordField Name="USER_ID" />
                    <ext:RecordField Name="USER_NAME" />
                    <ext:RecordField Name="DEPT_NAME" />
                    <ext:RecordField Name="OFFICE_PHONE" />
                    <ext:RecordField Name="INNER_PHONE" />
                    <ext:RecordField Name="CONTACT_PHONE" />
                    <ext:RecordField Name="IS_MANAGER" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Viewport runat="server">
        <Items>
            <ext:ColumnLayout ID="ColumnLayout1" runat="server" Split="false" Border="false"
                FitHeight="true">
                <Columns>
                    <ext:LayoutColumn ColumnWidth="0.25">
                        <ext:Panel ID="Panel1" runat="server" Border="false">
                            <Items>
                                <ext:FitLayout ID="FitLayout1" runat="server" ><Items>
                                <ext:TreePanel ID="TreePanel1" runat="server" Collapsible="false" AutoScroll="true" 
                                    Animate="true" Border="false">
                                    <Listeners>
                                        <BeforeLoad Fn="nodeLoad" />
                                        <Click Fn="nodeClick" />
                                        <ExpandNode Fn="clickNode" />
                                        <CollapseNode Fn="clickNode" />
                                    </Listeners>
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar2" runat="server" Height="26">
                                            <Items>
                                                <ext:ToolbarTextItem Text="所属部门" Height="40">
                                                </ext:ToolbarTextItem>
                                                <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                                                <ext:Button ID="Button4" runat="server" Text="" Width="0px" Disabled="true">
                                                </ext:Button>
                                            </Items>
                                        </ext:Toolbar>
                                    </TopBar>
                                </ext:TreePanel>
                                </Items>
                                </ext:FitLayout>
                            </Items>
                        </ext:Panel>
                    </ext:LayoutColumn>
                    <ext:LayoutColumn ColumnWidth="0.75">
                        <ext:Panel ID="Panel2" runat="server" BodyStyle="border-width:0 0 0 1px;" Layout="Fit" >
                            <Items>
                                
                                <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" Border="false" 
                                    AutoWidth="true" Layout="Fit" >
                                    <ColumnModel ID="ColumnModel1" runat="server">
                                        <Columns>
                                            <ext:RowNumbererColumn Header="序号" Width="35" />
                                            <ext:Column ColumnID="USER_ID" Css="" Header="<center>登陆帐号</center>" Sortable="true"
                                                DataIndex="USER_ID" Width="100" Groupable="False" />
                                            <ext:Column Header="<center>操作员</center>" Width="100" Sortable="true" DataIndex="USER_NAME"
                                                Groupable="True" Fixed="True" />
                                            <ext:Column Header="<center>所在部门</center>" Width="100" Sortable="true" DataIndex="DEPT_NAME" />
                                            <ext:Column Header="<center>移动电话</center>" Width="100" Sortable="true" DataIndex="CONTACT_PHONE" />
                                            <ext:Column Header="<center>是否拥有各个库房</center>" Width="100" Sortable="true" DataIndex="IS_MANAGER" >
                                                <Renderer Handler="return value ? '是' : '否';" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                                        </ext:RowSelectionModel>
                                    </SelectionModel>
                                    <LoadMask />
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar1" runat="server">
                                    <Items>
                                        <ext:Button ID="extBtn_Add" runat="server" Text="新增" Icon="Add">
                                            <DirectEvents>
                                                <Click OnEvent="OnExtBtnAddClick">
                                                    <ExtraParams>
                                                        <ext:Parameter Mode="Raw" Name="deptid" Value="#{TreePanel1}.getSelectionModel().getSelectedNode().id"></ext:Parameter>
                                                    </ExtraParams>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                        <ext:Button ID="extBtn_Edit" runat="server" Text="修改" Icon="GroupEdit">
                                        </ext:Button>
                                        <ext:Button ID="extBtn_Del" runat="server" Text="删除" Icon="Delete">
                                            <DirectEvents>
                                                <Click OnEvent="DelUser">
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                        <ext:TextField runat="server" ID="exttxtf_user_name" EmptyText="依角色或者姓名或拼音码查询...">
                                        </ext:TextField>
                                        <ext:Button ID="extBtn_Find" runat="server" Text="查询">
                                            <DirectEvents>
                                                <Click OnEvent="extBtn_Find_Click">
                                                    <%-- <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{GridPanel1}" />--%>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                                    </TopBar>
                                </ext:GridPanel>
                            </Items>
                        </ext:Panel>
                    </ext:LayoutColumn>
                </Columns>
            </ext:ColumnLayout>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
